package com.qianyu.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qianyu.project.entity.ContractChange;
import com.qianyu.project.mapper.provider.sy.ContractChangeProvider;
import com.qianyu.project.vo.ContractChangeVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public interface ContractChangeMapper extends BaseMapper<ContractChange> {
    @Select("select max(id) from contract_change where year(apply_date) = year(curdate())")
    String getMaxId();

    @SelectProvider(type = ContractChangeProvider.class, method = "getList")
    IPage<ContractChangeVo> getList(IPage page, Map<String, String> params);

    @SelectProvider(type = ContractChangeProvider.class, method = "getOne")
    ContractChangeVo getOne(String id);
}
